var app = angular.module('myApp', []);
app.controller('PlayerController', ['$scope', function($scope) {
	$scope.playing = false;
	$scope.audio = document.createElement('audio');
	$scope.audio.src = '/media/npr.mp4';
	$scope.play = function() {
	    $scope.audio.play();
	    $scope.playing = true;
	  };
	  $scope.stop = function() {
	    $scope.audio.pause();
	    $scope.playing = false;
	  };
	  $scope.audio.addEventListener('ended', function() {
	    $scope.$apply(function() {
	      $scope.stop()
	    });
	  });
}]);
app.controller('DemoController', function($scope) {
	  $scope.counter = 0;
	  $scope.add = function(amount) { $scope.counter += amount; };
	  $scope.subtract = function(amount) { $scope.counter -= amount; };
	});
//视频
app.controller('categoryController', function($scope,$http) {
	$http({
		method: 'GET',
		url: "/test.do"
	}).success(function(data, status) {
		$scope.data = data;
	}).error(function(err, status) {
		alert(err);
	});
});
